package chapter03.chapter05.Example1;

public class E1 {
    public static void main(String[] args) {
        String name = "蘑菇头";
        String str1 = new String();
        String str2 = new String("abcd");
        // 调用字符串数组String方法
        char [] charArray = new char[]{'D','E','F'};
        String str3 = new String(charArray);
        //调用字符串类构造方法 将byte 数组转化字符串
        byte [] byteArray = {97,98,99};
        String str4 = new String(byteArray);
        System.out.println("str1 = " +str1);
        System.out.println("str2 = " +str2);
        System.out.println("str3 = " +str3);
        System.out.println("str4 = " +str4);

    }
}
